import Pagination from '@inbiz/basic/Pagination';
import { getMessage } from '@inbiz/react';

export default function Pagenations(props: { pageData: any; onChange: any; }) {
  const { pageData, onChange } = props;

  return (
    <Pagination
      pagination={{
        showQuickJumper: true,
        showSizeChanger: true,
        defaultPageSize: 50,
        total: pageData.total,
        current: pageData.pageIndex,
        pageSize: pageData.pageSize,
        pageSizeOptions: ['10', '20', '30', '50', '100'],
        // @ts-ignore
        showTotal: true,
      }}
      onPageChange={({ current, pageSize }) => {
        onChange(current, pageSize);
      }}
      refreshData={() => {
        onChange(pageData.pageIndex, pageData.pageSize);
      }}
      pageRefresh={true}
    />
  );
}
